<?php
namespace app\admin\model;

use think\Model;
use think\Db;
use  think\Session;
class LoginModel extends Model
{
    public function login($username, $password)
    {
         $user = Db::name('admin')->where('adminname', $username)->where('adminpwd',md5($password))->find();
        if (!$user) {
            return 1;
        }
        else{
          Session::set('adminid',$user['adminid']);
            Session::set('clubid',$user['clubid']);
            return 2;
    }
}}